package com.gxa.service.impl;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageHelper;
import com.gxa.pojo.Role;
import com.gxa.pojo.Userinfo;
import com.gxa.dao.RoleMapper;
import com.gxa.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;

    //@Override
  //  public List<Role> selectRole(int pageNum, int pageSize) {
//
      //  PageHelper.startPage(pageNum, pageSize);
//
     //   List<Role> role = roleMapper.selectRole();
     //   return role;
   // }

        @Override
        public List<Role> showRole(int pageNum, int pageSize) {

            PageHelper.startPage(pageNum, pageSize);

            List<Role> role = roleMapper.selectRole();
            return role;
        }

  //  @Override
  //  public boolean insertRole(Role role) {
    //    return false;
  //  }

   // @Override
   // public List<Userinfo> query(Userinfo userinfo) {
  //      return null;
  // }


    // @Override
  //  public List<Userinfo> queryByPage(Userinfo userinfo, int page, int size) {
    //    return null;
   // }
   @Override
   public boolean insertRole(Role role) {
       return false;
   }
    @Override
    public boolean deleteRole(Role role) {
        return roleMapper.deleteRole(role)>0;
    }
}
